# Setup -------------------------------------------------------------------

## Clear R environment
rm(list = ls())

## Set working directory
setwd("../Replication")

# Install packages --------------------------------------------------------

source("install_packages.R")

# Load packages -----------------------------------------------------------

library(dplyr)
library(randomizr)
library(readr)
library(haven)

n_sims <- 10^5

# Clean data -------------------------------------------------------------

source("data/clean_data.R")

# Load data ---------------------------------------------------------------

load(file = "data/data.RData")

# Source helper functions -------------------------------------------------

source("code_and_output/helper_functions.R")

# Code to create Table 1 in manuscript -----------------------------------

source("code_and_output/tab_1_code.R")

# Code to create Table 3 in manuscript -----------------------------------

source("code_and_output/tab_3_code.R")

# Code to create Table 4 in manuscript -----------------------------------

source("code_and_output/tab_4_code.R")

# Code to create Table 5 in manuscript -----------------------------------

source("code_and_output/tab_5_code.R")

# Code to create Table 6 in manuscript -----------------------------------

source("code_and_output/tab_6_code.R")

# Code to create Table 7 in manuscript -----------------------------------

source("code_and_output/tab_7_code.R")

# Code to create Table 8 in manuscript -----------------------------------

source("code_and_output/tab_8_code.R")

## Print session info to console
cat("\n--- SESSION INFO ---\n")
print(sessionInfo())

## Save session info to a text file for submission
sink("sessionInfo.txt")
cat("--- SESSION INFO ---\n")
print(sessionInfo())
sink()
